.class public Lcom/netease/netstat/statistics/DownLinkThroughoutTest;
.super Lcom/netease/netstat/statistics/BaseTest;
.source "DownLinkThroughoutTest.java"


# instance fields
.field private dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

.field private wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;


# direct methods
.method public constructor <init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V
    .locals 0
    .parameter "telephony"
    .parameter "connectivity"
    .parameter "file"

    .prologue
    .line 22
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/netstat/statistics/BaseTest;-><init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V

    .line 23
    return-void
.end method


# virtual methods
.method public getserverinfo()V
    .locals 10

    .prologue
    .line 35
    :try_start_0
    sget-boolean v7, Lcom/netease/netstat/utils/Contanst;->airline:Z

    if-nez v7, :cond_1

    sget-boolean v7, Lcom/netease/netstat/utils/Contanst;->connectivity:Z

    if-eqz v7, :cond_1

    .line 36
    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

    if-eqz v7, :cond_1

    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;

    if-eqz v7, :cond_1

    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;

    invoke-virtual {v7}, Lcom/netease/mobistat/client/clients/WhoAmIClient;->getGlobalIP()Ljava/lang/String;

    move-result-object v7

    if-eqz v7, :cond_1

    .line 39
    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;

    invoke-virtual {v7}, Lcom/netease/mobistat/client/clients/WhoAmIClient;->getGlobalIP()Ljava/lang/String;

    move-result-object v5

    .line 40
    .local v5, gip:Ljava/lang/String;
    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

    invoke-virtual {v7}, Lcom/netease/mobistat/client/clients/DownlinkClient;->getDownlinkSize()J

    move-result-wide v0

    .line 41
    .local v0, dsize:J
    iget-object v7, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

    invoke-virtual {v7}, Lcom/netease/mobistat/client/clients/DownlinkClient;->getDownlinkTime()J

    move-result-wide v2

    .line 43
    .local v2, dtime:J
    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v7

    const/4 v8, 0x7

    if-le v7, v8, :cond_0

    .line 44
    invoke-virtual {v5}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v7

    const/4 v8, 0x1

    const-string v9, ":"

    invoke-virtual {v5, v9}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v9

    invoke-virtual {v7, v8, v9}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Lcom/netease/netstat/utils/Contanst;->setGlobalip(Ljava/lang/String;)V

    .line 45
    :cond_0
    const-wide/16 v7, 0x0

    cmp-long v7, v2, v7

    if-lez v7, :cond_1

    .line 46
    div-long v7, v0, v2

    long-to-float v6, v7

    .line 47
    .local v6, rate:F
    invoke-static {v6}, Lcom/netease/netstat/utils/Contanst;->setTcpdownlink(F)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 54
    .end local v0           #dsize:J
    .end local v2           #dtime:J
    .end local v5           #gip:Ljava/lang/String;
    .end local v6           #rate:F
    :cond_1
    :goto_0
    return-void

    .line 51
    :catch_0
    move-exception v4

    .line 52
    .local v4, e:Ljava/lang/Exception;
    invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public startserver()V
    .locals 1

    .prologue
    .line 27
    new-instance v0, Lcom/netease/mobistat/client/clients/DownlinkClient;

    invoke-direct {v0}, Lcom/netease/mobistat/client/clients/DownlinkClient;-><init>()V

    iput-object v0, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

    .line 28
    new-instance v0, Lcom/netease/mobistat/client/clients/WhoAmIClient;

    invoke-direct {v0}, Lcom/netease/mobistat/client/clients/WhoAmIClient;-><init>()V

    iput-object v0, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;

    .line 29
    iget-object v0, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->wClient:Lcom/netease/mobistat/client/clients/WhoAmIClient;

    invoke-virtual {v0}, Lcom/netease/mobistat/client/clients/WhoAmIClient;->run()V

    .line 30
    iget-object v0, p0, Lcom/netease/netstat/statistics/DownLinkThroughoutTest;->dClient:Lcom/netease/mobistat/client/clients/DownlinkClient;

    invoke-virtual {v0}, Lcom/netease/mobistat/client/clients/DownlinkClient;->run()V

    .line 31
    return-void
.end method
